For the development platform, if the data storage has good support, then the development of the application will have a great role in promoting.
In general, there are three ways to store data: One is a file, one is a database, and the other is a network. Where files and databases may be used a little more, the file is easy to use, the program can define its own format; The database used a bit annoying lock some, but it has its advantages, such as in the massive data performance is superior, the
Android System integrates a lightweight database:SQLite, so Android support for the database is very good, each application can easily use it. As an embedded database engine, SQLite is dedicated to the right amount of data access on devices with limited resources, and now mainstream mobile devices like Android, iphone and so on are using SQLite as a storage engin
In actual development, we sometimes need to store or back up more complex data. These data are characterized by many content, large structure, such as SMS Backup. We know that sharedpreferences and files (text files) can be very inefficient in storing such data. If you have learned Javaweb's friends, the first thing you may think of is a database. Of course the database is a solution, so is there any other solution? Today we're talking about how data is stor
file to accommodate multiple resolutions whenever possible.
Iv. Other folders
materials (other files that need to be used in the project can be set up on their own, but this folder will not be packaged into the project, just as other auxiliary files for development convenience,
Android In addition to provide/res directory storage resource files, in the/assets directory will also provide storage resources files
This article is translated from https://www.securecoding.cert.org/confluence/display/java/DRD00-J.+Do+not+store+sensitive+information+on+ External+storage+%28sd+card%29+unless+encrypted+first, there are additional deletions.Android offers several options for saving persistent application data, one of which is external storage (/sdcard,/mnt/sdcard). The external storage contains a miniature or standard-sized SD card inside the device. Mount the Android
[Android Development] example 4-guess the box in which the gem is stored, android4-A mini game that implements "Guess which box the gem is placed in": There are three boxes in the main interface. clicking any box will open the box and show whether there are any gems in it, in addition, the box that has not been clicked is set to semi-transparent. The box that has been clicked is displayed normally, and the
As a complete application, data storage operations are essential. As a result, the Android system offers four ways to store data. are: Sharepreference, SQLite, Content provider, and file. As the Android system, the data are basically private, are stored in the "data/data/package name" directory, so to achieve data sharing, the correct way is to use the content Pr
information or structured data), such as text files, binaries, PC files,multimedia files, downloaded files, etc... Try not to create files;? If a file is created, if it is a private file or an important file, it is stored on-premises, otherwise it is stored externally. The first type: using Sharedpreferences to store data sharedpreferences is a lightweight storage class on the
manipulate, the path should be built according to the businessID unique Callout Request data: The ID of the data we want to requestget through Contentresolver ContentProvider basic steps for contentFirst: Get Contentresolver class object: Contentresolver CR = Getcontentresolver ();Second: Defines the field string array to query.Third: Use Cr.query (); Returns a Cursor object.IV: Use the while loop to get the contents of the cursor.Steps to customize ContentProvider1. inherit Android's ContentPr
data needs to be written, which is the writing data is done by the editor object,if (textutils.isempty (name) | | Textutils.isempty (pwd)) {//To determine if the input data is empty or empty, then make a hintToast.maketext (This, "account name or password cannot be empty", Toast.length_short). Show ();}else {//When you click the OK button, you need to write the data, which is the write data is done by the editor objectEditor editor = Sp.edit ();if (issavebox.ischecked ()) {//When the user choos
1, Sharedpreferences is the most easily understood data storage technology in Android, in fact sharedpreferences processing is a key-value (key value pair). Sharedpreferences is often used to store some lightweight datapublic void Setsharevalue () {Instantiate the Sharedpreferences object (the first step) to the name of the local XML file---TestSharedpreferences mysharedpreferences = getsharedpreferences ("Test", activity.mode_private);Instantiate the
The Android platform provides us with a sharedpreferences class, which is a lightweight storage class that is especially suitable for saving software configuration parameters. Use Sharedpreferences to save the data, behind it is the XML file to hold the data, the file is stored in the/data/data/Store:Sharedpreferences sp=getsharedpreferences ("UItest", activity.mode_append);Sharedpreferences.editor Editor=s
/,pictures/,ringtone/. If you do not want the system's multimedia browser to be able to browse your multimedia files, you can add. nomedia files to your directory. The method of getting a public directory getextenrnalStoragepublicdirectory () will participate directory_music/directory_pictures/directory _ringtone incoming.to Add a brochure under the Public picture directory: Public FileGetalbumstoragedir(StringAlbumname) { //Get The directory for the user's public pictures directory. Filefile=
(mcursor.movetonext ()) {//print log to view the value of the photo id long id = mcursor.getlong (mcurso R.getcolumnindex (mediastore.images.media._id)); LOG.I ("mediastore.images.media_id=", ID + ""); Filter out unwanted images, just get pictures of photos stored in the photo album after the picture String path = mcursor.getstring (Mcursor.getcolumnindex (MEDIASTORE.IMAGES.MEDIA.D ATA)); if (Path.startswi
view the value of the photo ID longid= Mcursor.getlong (Mcursor.getcolumnindex (mediastOre. images.media._id)); NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;LOG.I ("mediastore.images.media_id=", id+ "");// filter out unwanted images, Only get pictures in albums that store photos after taking pictures stringpath=mcursor.getstring ( Mcursor.getcolumnindex (MediaStore.Images.Media.DATA));if ( Path.startswith (sdcardpath+ "/dcim/100media") | | path.startswith (sdcardpath+ "/dcim/camera/") | | path.startswith (sd
In Android, The Drawable resource ID is stored on the Sdcard, And the drawablesdcard
The process is divided into three steps:1. Convert resource ID to Drawable2. Convert Drawable to Bitmap3. Store Bitmap on Sdcard
The Code is as follows:
Public class MainActivity extends ActionBarActivity {@ Override protected void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (
Android gets multiple recent photos from the album (get the photos stored by the camera)
When you are working on a company project, you need to customize the grid view of the displayed photos to display the first 20 photos that you have taken with a recent camera.
I checked the API provided by the system and did not find the path constant pointing directly to storing photos after taking photos with a camer
1. Android Phone has cell phone memory RAM also has SD card, see where we install, if we installed in SD card if we find the Tencent directory to find the data directory, there will be a qq_database file, the file copied to the computer, Then use the QQ Chat record viewer can be viewed.
2. Installed in the mobile phone storage space, it is necessary to use the RE file manager, find/data/data/com.tencent.qq/databases/folder, which can see the Qq_datab
Sometimes the user name and password are saved in sharedpreference for easy login, but if the password is not processed it will be saved in clear text.The Java layer in Android provides the tool class: android.util.Base64; encode and decode the password with Base64.1 //Base64 Code:2 byte[] encode = Base64.encode ("Hello, World". GetBytes (), base64.default);3 4String enc =NewString (encode);5 6LOG.D ("", "base encode =" +enc);7 8 //Base64 decoding:9 b
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.